package edu.zju.gis.dbfg.common.exception;

import edu.zju.gis.dbfg.common.base.BaseException;
import edu.zju.gis.dbfg.common.constant.CodeConstants;
import lombok.Getter;

import java.util.Arrays;

/**
 * @author Hu
 * @date 2019/4/29
 * 服务异常
 **/
@Getter
public class ServiceException extends BaseException {

  public ServiceException(Class clz, String method, String msg, String... data){
    super(CodeConstants.SERVICE_ERROR, String.format("服务异常：%s, %s, %s，%s", clz.getName(), method, Arrays.toString(data), msg));
  }

  public ServiceException(int code, Class clz, String method, String msg, String... data){
    super(code, String.format("服务异常：%s, %s, %s，%s", clz.getName(), method, Arrays.toString(data), msg));
  }

}
